<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>

	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"> <a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a> </div>
				<div class="col-xs-8"><h2>工程签证管理</h2></div>
				<div class="col-xs-2 text-right"><a href="#"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl class="erp-list">
				</dl>
				<div class="showlists">暂无更多数据</div>
				<div style="margin-bottom: 80px;"></div>
				<div class="order-send"><a href="visa-apply.html" class="btn btn-warning">申请签证</a></div>
			</div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" class="pro pro-input pro-name" placeholder="请输入项目名称"/>
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test01" name="begintime" placeholder="请输入开始时间">
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test02" name="begintime" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
							<input class="sub-cover btns fr" type="button" value="确定"/>
							
						</div>

					</form>

				</div>
			</div>

		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script>
    layui.use(['form', 'layedit', 'laydate','table','laytpl','flow'], function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test01'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#test02'
            ,type: 'datetime'
        });
    })

    var formData = {
        type:'a',
        proName:'',
        begintime:'',
        endtime:'',
    };
    //滚动加载
    var nloader = LoadMore({
        api: 'api/buil/builSignHisList.do',
        data: formData,
        success: function (data) {
            sessionStorage.xiala=JSON.stringify(data.fullDown.contracts);
            console.log(data)
            var datas=data.data;
            if(datas.length<=0){
                $('.showlists').show();
            }else{
                $('.showlists').hide();
            }
            for(var i=0;i<datas.length;i++){
                switch (datas[i].state){
                    case -1:
                        datas[i].state='进行中';
                        break;
                    case 0:
                        datas[i].state='已审核';
                        break;
                };

                $('.erp-list').append('<dd>' +
                    '<a href="visa-details.html" ids="'+datas[i].cs_id+'">' +
                    '<h3>'+datas[i].cc_code+
					'<span class="btn btn-danger fr">'+datas[i].state+'</span>\n</h3>' +
                    '<div class="erp-txt">' +
                    '<p><span>工程名称:</span>'+datas[i].proName+'</p>' +
                    '<p><span>施工单位:</span>'+datas[i].compName1+'</p>' +
                    '<p><span>签证内容:</span>'+datas[i].s_Content+'</p>' +
                    '<p><span>审核记录:</span>通过次数'+datas[i].vokNum+'</p>' +
                    '<p><span>申请时间:</span>'+datas[i].s_Time+'</p>' +
                    '</div>' +
                    '</a>' +
                    '</dd>')

            }
        }
    })

    $(document).on('click','a',function () {
		sessionStorage.cs_id=$(this).attr('ids');
    })


	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();
	});


//	点击取消按钮
	$(".close-cover").click(function(){
		$(".search-box").slideUp();
	});
//	点击确定按钮
	$(".sub-cover").click(function(){
		console.log($(".pro-name").val());
		console.log($("#test01").val());
		console.log($("#test02").val());
		$(".search-box").slideUp();
        $('.erp-list').html('');
        formData.proName=$(".pro-name").val();
        formData.begintime=$('#test01').val();
        formData.endtime= $('#test02').val();
        nloader.search();

    });
</script>










